package com.xiong.wuliao.util;

import android.support.v4.app.Fragment;

import com.xiong.wuliao.mainfragment.CategoryFragment;
import com.xiong.wuliao.mainfragment.GoodFragment;
import com.xiong.wuliao.mainfragment.HomeFragment;
import com.xiong.wuliao.mainfragment.MineFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * 主页四个Fragment的工具类
 */
public class FragmentMainUtil {
    static List<Fragment> fragments = new ArrayList<>();
    private static final HomeFragment homeFragment;
    private static final CategoryFragment categoryFragmnet;
    private static final GoodFragment goodFragment;
    private static final MineFragment mineFragment;

    static {
        homeFragment = new HomeFragment();
        categoryFragmnet = new CategoryFragment();
        goodFragment = new GoodFragment();
        mineFragment = new MineFragment();

        fragments.add(homeFragment);
        fragments.add(categoryFragmnet);
        fragments.add(goodFragment);
        fragments.add(mineFragment);
    }

    public static List<Fragment> getFragments(){
        return fragments;
    }

    public static int getFragmentSize(){
        return fragments.size();
    }

}